function indexSecondRefresh() {
  indexSecond(function () {});
}
setInterval(indexSecondRefresh, 5000);
function indexSecond(fn) {
  //线路车站数
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnStatnNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          lineStationNumData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".lineStationNum_max").text(data.data.max);
            if (lineStationNumData.length !== 0) {
              lineStationNumlnNm = lineStationNumData.map((v) => v.lnNm);
              lineStationNumlnStatnNr = lineStationNumData.map(
                (v) => v.lnStatnNr
              );
              lineStationNumChart();
            } else {
              $(".lineStationNum_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".lineStationNum_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".lineStationNum_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //线路车辆数(列)
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnVehNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          lineVehiclesNumData = data.data.datas;
          if (Object.keys(data.data).length !== 0) {
            $(".lineVehiclesNum_num").text(data.data.min);
            if (lineVehiclesNumData.length !== 0) {
              lineVehiclesNumlnNm = lineVehiclesNumData.map((v) => v.lnNm);
              lineVehiclesNumlnOnLnVehNr = lineVehiclesNumData.map(
                (v) => v.lnOnLnVehNr
              );
              lineVehiclesNumlnAvlVehNr = lineVehiclesNumData.map(
                (v) => v.lnAvlVehNr - v.lnOnLnVehNr
              );
              lineVehiclesNumlnAtchVehNr = lineVehiclesNumData.map(
                (v) => v.lnAtchVehNr - v.lnAvlVehNr
              );
              lineVehiclesNumChart();
            } else {
              $(".lineStationNum_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".lineStationNum_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".numLineVehicles_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //线路车辆数(辆)
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnVehUntNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          numLineVehiclesData = data.data.datas;
          if (Object.keys(data.data).length !== 0) {
            $(".numLineVehicles_num").text(data.data.min);
            if (numLineVehiclesData.length !== 0) {
              numLineVehicleslnNm = numLineVehiclesData.map((v) => v.lnNm);
              numLineVehicleslnOnLnVehNr = numLineVehiclesData.map(
                (v) => v.lnOnLnVehUntNr
              );
              numLineVehicleslnAvlVehNr = numLineVehiclesData.map(
                (v) => v.lnAvlVehUntNr - v.lnOnLnVehUntNr
              );
              numLineVehicleslnAtchVehNr = numLineVehiclesData.map(
                (v) => v.lnAtchVehUntNr - v.lnAvlVehUntNr
              );
              numLineVehiclesChart();
            } else {
              $(".numLineVehicles_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".numLineVehicles_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".numLineVehicles_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  // 线路客运量;
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnHistPasgrNrAndLnDlyPasgrNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          linePassengerVData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".linePassengerV_max").text(data.data.max);
            if (linePassengerVData.length !== 0) {
              linePassengerVlnDlyPasgrNr = linePassengerVData.map(
                (v) => v.lnDlyPasgrNr
              );
              linePassengerVlnNm = linePassengerVData.map((v) => v.lnNm);
              linePassengerVlnHistPasgrNr = linePassengerVData.map(
                (v) => v.lnHistPasgrNr
              );
              linePassengerVChart();
            } else {
              $(".linePassengerVChart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".linePassengerVChart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".linePassengerVChart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });

  //高峰小时最大拥挤度
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/trnHrHghMaxCrddDgr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          passengerVolumeData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".peakMaxCongest_average").text(data.data.avg);
            if (
              data.data.lastMonth.length !== 0 ||
              data.data.thisMonth.length !== 0
            ) {
              var passengerVolumelastMonth = [];
              var passengerVolumethisMonth = [];
              var passengerVolumelnNmlast = [];
              var passengerVolumelnNmthis = [];
              var passengerVolumeSctnl = [];
              var passengerVolumeSctnt = [];

              for (var i = 0; i < data.data.lastMonth.length; i++) {
                passengerVolumelastMonth[i] = [
                  0,
                  i,
                  Math.ceil(data.data.lastMonth[i].trnHrHghMaxCrddDgr),
                ];
                passengerVolumelnNmlast[i] = data.data.lastMonth[i].lnNm;
                passengerVolumeSctnl[i] = data.data.lastMonth[i].sctn;
              }
              for (var i = 0; i < data.data.thisMonth.length; i++) {
                passengerVolumethisMonth[i] = [
                  1,
                  i,
                  Math.ceil(data.data.thisMonth[i].trnHrHghMaxCrddDgr),
                ];
                passengerVolumelnNmthis[i] = data.data.thisMonth[i].lnNm;
                passengerVolumeSctnt[i] = data.data.thisMonth[i].sctn;
              }
              passengerVolume = passengerVolumelastMonth.concat(
                passengerVolumethisMonth
              );
              passengerVolumelnNm = passengerVolumelnNmlast.concat(
                passengerVolumelnNmthis
              );
              passengerVolumeSctn = passengerVolumeSctnl.concat(
                passengerVolumeSctnt
              );

              passengerVolumelnNmNn = new Set(passengerVolumelnNm);
              passengerVolumelnNmN = [...passengerVolumelnNmNn];

              passengerVolumeSctnn = new Set(passengerVolumeSctn);
              passengerVolumeSctnN = [...passengerVolumeSctnn];

              if (passengerVolumeSctnN[0] === "202001") {
                passengerVolumeSctnN[0] = "2020年\n一季度";
              }
              if (passengerVolumeSctnN[1] === "202002") {
                passengerVolumeSctnN[1] = "2020年\n二季度";
              }
              passengerVolumeChart();
            } else {
              $(".peakMaxCongest_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".peakMaxCongest_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".peakMaxCongest_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //日均客运周转量
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnDlyPasgrTrnvrNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          averageDailyPassNumData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".averageDailyPassNum_max").text(data.data.max);
            if (averageDailyPassNumData.length !== 0) {
              averageDailyPassNumlnDly = averageDailyPassNumData.map(
                (v) => v.lnDlyPasgrTrnvrNr
              );
              averageDailyPassNumlnNm = averageDailyPassNumData.map(
                (v) => v.lnNm
              );
              averageDailyPassNumChart();
            } else {
              $(".linePassengerVChart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".linePassengerVChart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".linePassengerVChart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //日均运营里程
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnDlyOptgKmAndLnDlyOptgUntKm",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          averageDailyOperaData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".averageDailyOpera_max").text(
              data.data.max.maxLnDlyOptgKm.toFixed(2) +
                "/" +
                data.data.max.maxLnDlyOptgUntKm.toFixed(2)
            );
            if (averageDailyOperaData.length !== 0) {
              averageDailyOperalnDlyOptgKm = averageDailyOperaData.map(
                (v) => -v.lnDlyOptgKm
              );
              averageDailyOperalnDlyOptgUntKm = averageDailyOperaData.map(
                (v) => v.lnDlyOptgUntKm
              );
              averageDailyOperalnNm = averageDailyOperaData.map((v) => v.lnNm);
              averageDailyOperaChart();
            } else {
              $(".linePassengerVChart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".linePassengerVChart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".linePassengerVChart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  // 加开列次
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnXtraUntNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          additionalTrainsData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".additionalTrains_max").text(data.data.max);
            if (additionalTrainsData.length !== 0) {
              additionalTrainslnXtraUntNr = additionalTrainsData.map(
                (v) => v.lnXtraUntNr
              );
              additionalTrainslnNm = additionalTrainsData.map((v) => v.lnNm);
              additionalTrainsChart();
            } else {
              $(".onTimeTrain_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".onTimeTrain_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".onTimeTrain_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //总行驶里程
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnTotlUntKm",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          totalMileageData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".totalMileage_max").text(data.data.max);
            if (totalMileageData.length !== 0) {
              totalMileagelnTotlUntKm = totalMileageData.map(
                (v) => v.lnTotlUntKm
              );
              totalMileagelnNm = totalMileageData.map((v) => v.lnNm);
              totalMileageChart();
            } else {
              $(".totalMileage_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".totalMileage_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".totalMileage_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });

  //开行列次
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnPlnOpnUntNrAndLnFOpnUntNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          trainNumberData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".trainNumber_average").text(data.data.max);
            if (trainNumberData.length !== 0) {
              trainNumberlnPlnOpnUntNr = trainNumberData.map(
                (v) => v.lnPlnOpnUntNr
              );
              trainNumberlnFOpnUntNr = trainNumberData.map(
                (v) => v.lnFOpnUntNr
              );
              trainNumberlnNm = trainNumberData.map((v) => v.lnNm);
              trainNumberChart();
            } else {
              $(".trainNumber_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".trainNumber_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".trainNumber_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
  //准点列车次数
  $.ajax({
    type: "get",
    async: true, //异步执行
    url: base_url + "/lnOnSchdlUntNr",
    dataType: "json", //返回数据形式为json
    success: function (data) {
      if (data.code == 1000) {
        if (data.data !== null) {
          onTimeTrainData = data.data.dataList;
          if (Object.keys(data.data).length !== 0) {
            $(".onTimeTrain_max").text(data.data.max);
            if (onTimeTrainData.length !== 0) {
              onTimeTrainlnOnSchdlUntNr = onTimeTrainData.map(
                (v) => v.lnOnSchdlUntNr
              );
              onTimeTrainlnNm = onTimeTrainData.map((v) => v.lnNm);
              onTimeTrainChart();
            } else {
              $(".onTimeTrain_chart").html(
                "<div class='noData'>今日暂无数据</div>"
              );
            }
          } else {
            $(".onTimeTrain_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $(".onTimeTrain_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        alert(data.message);
      }
      fn();
    },
    error: function (errorMsg) {
      console.log("请求数据失败");
    },
  });
}
indexSecond(function () {});

//线路车站数
// lineStationNumChart();
function lineStationNumChart() {
  let lineStationNumC = document.getElementsByClassName("lineStationNum_chart");
  for (var i = 0; i < lineStationNumC.length; i++) {
    let myChart = echarts.init(lineStationNumC[i]);
    var img1 = {
      a: base_img + "/subway-iconA.png",
      b: base_img + "/subway-iconAs.png",
    };

    var img2 = {
      a: base_img + "/subway-iconB.png",
      b: base_img + "/subway-iconBs.png",
    };

    var img3 = {
      a: base_img + "/subway-iconC.png",
      b: base_img + "/subway-iconCs.png",
    };

    var img4 = {
      a: base_img + "/subway-iconD.png",
      b: base_img + "/subway-iconDs.png",
    };

    var img5 = {
      a: base_img + "/subway-iconE.png",
      b: base_img + "/subway-iconEs.png",
    };
    var img6 = {
      a: base_img + "/subway-iconA.png",
      b: base_img + "/subway-iconAs.png",
    };

    var img7 = {
      a: base_img + "/subway-iconB.png",
      b: base_img + "/subway-iconBs.png",
    };

    var img8 = {
      a: base_img + "/subway-iconC.png",
      b: base_img + "/subway-iconCs.png",
    };

    var img9 = {
      a: base_img + "/subway-iconD.png",
      b: base_img + "/subway-iconDs.png",
    };

    var img10 = {
      a: base_img + "/subway-iconE.png",
      b: base_img + "/subway-iconEs.png",
    };

    var value = 1; // >0

    option = {
      title: {
        //text: "某某国家警力控制TOP5 - 自定义柱状图",
        //subtext: "pictorialBar - 自定义柱状图",
        textStyle: {
          color: "#fff",
          fontSize: 16,
        },
        left: "4.5%",
        top: "25%",
      },
      // backgroundColor: "#2c343c",
      grid: {
        left: "2%",
        top: "3%",
        bottom: "3%",
        right: "20%",
        containLabel: true,
      },
      tooltip: {
        trigger: "item",
      },
      xAxis: {
        splitLine: {
          show: false,
        },
        axisLine: {
          show: false,
        },
        axisLabel: {
          show: false,
        },
        axisTick: {
          show: false,
        },
      },
      yAxis: [
        {
          type: "category",
          inverse: false,
          data: lineStationNumlnNm,
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: false,
            lineStyle: {
              type: "dashed",
              color: "#3e86dd",
            },
          },
          axisLabel: {
            margin: 35,
            textStyle: {
              color: "#fff",
              fontSize: 14,
            },
          },
        },
      ],
      series: [
        {
          tooltip: {
            show: false,
          },
          z: 4,
          type: "pictorialBar",
          symbolSize: ["20", "20"],
          symbolRepeat: "fixed",
          data: [
            {
              value: value,
              symbol: "image://" + img1.b,
            },
            {
              value: value,
              symbol: "image://" + img2.b,
            },
            {
              value: value,
              symbol: "image://" + img3.b,
            },
            {
              value: value,
              symbol: "image://" + img4.b,
            },
            {
              value: value,
              symbol: "image://" + img5.b,
            },
            {
              value: value,
              symbol: "image://" + img6.b,
            },
            {
              value: value,
              symbol: "image://" + img7.b,
            },
            {
              value: value,
              symbol: "image://" + img8.b,
            },
            {
              value: value,
              symbol: "image://" + img9.b,
            },
            {
              value: value,
              symbol: "image://" + img10.b,
            },
          ],
        },
        {
          z: 6,
          type: "pictorialBar",

          symbolSize: ["20", "20"],

          animation: true,
          symbolRepeat: "fixed",
          symbolClip: true,
          symbolPosition: "start",
          symbolOffset: [0, 0],
          data: [
            {
              value: lineStationNumlnStatnNr[0],
              symbol: "image://" + img1.a,
            },
            {
              value: lineStationNumlnStatnNr[1],
              symbol: "image://" + img2.a,
            },
            {
              value: lineStationNumlnStatnNr[2],
              symbol: "image://" + img3.a,
            },
            {
              value: lineStationNumlnStatnNr[3],
              symbol: "image://" + img4.a,
            },
            {
              value: lineStationNumlnStatnNr[4],
              symbol: "image://" + img5.a,
            },
            {
              value: lineStationNumlnStatnNr[5],
              symbol: "image://" + img1.a,
            },
            {
              value: lineStationNumlnStatnNr[6],
              symbol: "image://" + img2.a,
            },
            {
              value: lineStationNumlnStatnNr[7],
              symbol: "image://" + img3.a,
            },
            {
              value: lineStationNumlnStatnNr[8],
              symbol: "image://" + img4.a,
            },
            {
              value: lineStationNumlnStatnNr[9],
              symbol: "image://" + img5.a,
            },
          ],
          label: {
            normal: {
              show: true,
              textStyle: {
                color: "#18fcff",
                fontSize: 14,
              },
              position: "right",
              offset: [35, 0],
            },
          },
        },
        {
          type: "bar",
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

//线路客运量
// linePassengerVChart();
function linePassengerVChart() {
  let linePassengerVC = document.getElementsByClassName("linePassengerVChart");
  for (var i = 0; i < linePassengerVC.length; i++) {
    let myChart = echarts.init(linePassengerVC[i]);
    option = {
      tooltip: {},
      grid: {
        top: "15%",
        left: "13%",
        right: "4%",
        bottom: "15%",
      },
      legend: {
        itemGap: 50,
        data: ["日均客运量", "最高日客运量"],
        textStyle: {
          color: "#f9f9f9",
          borderColor: "#fff",
        },
      },
      xAxis: [
        {
          type: "category",
          boundaryGap: true,
          axisLine: {
            //坐标轴轴线相关设置。数学上的x轴
            show: true,
            lineStyle: {
              color: "#f9f9f9",
            },
          },
          axisLabel: {
            interval: 0,
            rotate: 45,
            //坐标轴刻度标签的相关设置
            textStyle: {
              color: "#fff",
              fontSize: 10,
              // margin: 15,
            },
          },
          axisTick: {
            show: false,
          },
          data: linePassengerVlnNm,
        },
      ],
      yAxis: [
        {
          type: "value",
          min: 0,
          // max: 140,
          splitNumber: 7,
          splitLine: {
            show: true,
            lineStyle: {
              color: "#0a3256",
            },
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            margin: 15,
            textStyle: {
              color: "#fff",
            },
          },
          axisTick: {
            show: false,
          },
        },
      ],
      series: [
        {
          name: "最高日客运量",
          type: "line",
          // smooth: true, //是否平滑曲线显示
          // 			symbol:'circle',  // 默认是空心圆（中间是白色的），改成实心圆
          showAllSymbol: true,
          symbol: "emptyCircle",
          symbolSize: 6,
          lineStyle: {
            normal: {
              color: "#28ffb3", // 线条颜色
            },
            borderColor: "#f0f",
          },
          label: {
            show: true,
            position: "top",
            textStyle: {
              color: "#fff",
              fontSize: "10",
            },
          },
          itemStyle: {
            normal: {
              color: "#28ffb3",
            },
          },
          tooltip: {
            show: false,
          },
          areaStyle: {
            //区域填充样式
            normal: {
              //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: "rgba(0,154,120,1)",
                  },
                  {
                    offset: 1,
                    color: "rgba(0,0,0, 0)",
                  },
                ],
                false
              ),
              shadowColor: "rgba(53,142,215, 0.9)", //阴影颜色
              shadowBlur: 20, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
            },
          },
          data: linePassengerVlnHistPasgrNr,
        },
        {
          name: "日均客运量",
          type: "bar",
          barWidth: "70%",
          tooltip: {
            show: false,
          },
          label: {
            show: false,
            position: "top",
            textStyle: {
              color: "#0EA0D3",
              fontSize: "10",
            },
          },
          itemStyle: {
            normal: {
              // barBorderRadius: 5,
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#14c8d4",
                },
                {
                  offset: 1,
                  color: "#10cdff",
                },
              ]),
            },
          },
          data: linePassengerVlnDlyPasgrNr,
        },
      ],
    };
    myChart.setOption(option);
  }
}
// 高峰小时最大拥挤度
// passengerVolumeChart();
function passengerVolumeChart() {
  let peakMaxCongestC = document.getElementsByClassName("peakMaxCongest_chart");
  for (var i = 0; i < peakMaxCongestC.length; i++) {
    let myChart = echarts.init(peakMaxCongestC[i]);
    data = passengerVolume.map(function (item) {
      return [item[1], item[0], item[2] || "-"];
    });

    option = {
      tooltip: {
        position: "top",
      },
      animation: false,
      grid: {
        height: "70%",
        y: "5%",
        left: "17%",
        right: "3%",
      },
      xAxis: {
        type: "category",
        data: passengerVolumelnNmN,
        splitArea: {
          show: true,
        },
        axisLabel: {
          interval: 0,
          rotate: 45,
          textStyle: {
            color: "#ffffff",
            fontSize: 10,
          },
        },
      },
      yAxis: {
        type: "category",
        data: passengerVolumeSctnN,
        splitArea: {
          show: true,
        },
        axisLabel: {
          textStyle: {
            color: "#ffffff",
          },
        },
      },
      visualMap: {
        min: 50,
        max: 130,
        calculable: true,
        orient: "horizontal",
        left: "center",
        bottom: "0%",
        inRange: {
          color: ["green", "yellow", "red"],
        },
        textStyle: {
          color: "#fff",
        },
      },
      series: [
        {
          name: "",
          type: "heatmap",
          data: data,
          label: {
            normal: {
              show: true,
              color: "#000",
            },
          },
          itemStyle: {
            fontSize: "20",
            emphasis: {
              shadowBlur: 100,
              shadowColor: "rgba(0, 0, 0, 0.5)",
            },
          },
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

// 日均客运周转量
// averageDailyPassNumChart();
function averageDailyPassNumChart() {
  let averageDailyPassNumC = document.getElementsByClassName(
    "averageDailyPassNum_chart"
  );
  for (var i = 0; i < averageDailyPassNumC.length; i++) {
    let myChart = echarts.init(averageDailyPassNumC[i]);
    var myColor = [
      "#eb2100",
      "#eb3600",
      "#d0570e",
      "#d0a00e",
      "#34da62",
      "#00e9db",
      "#00c0e9",
      "#0096f3",
      "#33CCFF",
      "#33FFCC",
    ];
    option = {
      grid: {
        left: "19%",
        top: "5%",
        right: "8%",
        bottom: "0%",
        // containLabel: true,
      },
      xAxis: [
        {
          show: false,
        },
      ],
      yAxis: [
        {
          axisTick: "none",
          axisLine: "none",
          offset: "10",
          axisLabel: {
            textStyle: {
              color: "#ffffff",
              fontSize: "10",
            },
          },
          data: averageDailyPassNumlnNm,
        },
        {
          axisTick: "none",
          axisLine: "none",
          axisLabel: {
            textStyle: {
              color: "#ffffff",
              fontSize: "10",
            },
          },
          data: ["10", "9", "8", "7", "6", "5", "4", "3", "2", "1"],
        },
        {
          name: "日均客运周转量TOP 10",
          nameGap: "50",
          nameTextStyle: {
            color: "#ffffff",
            fontSize: "16",
          },
          axisLine: {
            lineStyle: {
              color: "rgba(0,0,0,0)",
            },
          },
          data: [],
        },
      ],
      series: [
        {
          name: "条",
          type: "bar",
          yAxisIndex: 0,
          data: averageDailyPassNumlnDly,
          label: {
            normal: {
              show: true,
              position: "right",
              textStyle: {
                color: "#ffffff",
                fontSize: "10",
              },
            },
          },
          barWidth: 4,
          itemStyle: {
            normal: {
              color: function (params) {
                var num = myColor.length;
                return myColor[params.dataIndex % num];
              },
            },
          },
          z: 2,
        },
        {
          name: "白框",
          type: "bar",
          yAxisIndex: 1,
          barGap: "-100%",
          data: [
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
            885.5,
          ],
          barWidth: 12,
          itemStyle: {
            normal: {
              color: "#0e2147",
              barBorderRadius: 1,
            },
          },
          z: 1,
        },
        {
          name: "外框",
          type: "bar",
          yAxisIndex: 2,
          barGap: "-100%",
          data: [890, 890, 890, 890, 890, 890, 890, 890, 890, 890],
          barWidth: 14,
          itemStyle: {
            normal: {
              color: function (params) {
                var num = myColor.length;
                return myColor[params.dataIndex % num];
              },
              barBorderRadius: 1,
            },
          },
          z: 0,
        },
        {
          name: "外圆",
          type: "scatter",
          hoverAnimation: false,
          data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          yAxisIndex: 2,
          symbolSize: 20,
          itemStyle: {
            normal: {
              color: function (params) {
                var num = myColor.length;
                return myColor[params.dataIndex % num];
              },
              opacity: 1,
            },
          },
          z: 2,
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}
// 日均运营里程
// averageDailyOperaChart();
function averageDailyOperaChart() {
  let averageDailyOperaC = document.getElementsByClassName(
    "averageDailyOpera_chart"
  );
  for (var i = 0; i < averageDailyOperaC.length; i++) {
    let myChart = echarts.init(averageDailyOperaC[i]);
    var labelData = averageDailyOperalnNm;
    var manData = averageDailyOperalnDlyOptgUntKm;
    var womanData = averageDailyOperalnDlyOptgKm;
    option = {
      legend: {
        data: ["万列公里/日", "万车公里/日"],
        textStyle: {
          color: "#fff",
        },
      },
      // tooltip（提示框组件）
      tooltip: {
        //trigger(触发类型)，可选'item','axis','none'
        trigger: "axis",
        axisPointer: {
          //指示器类型,可选'line','shadow','cross'
          type: "shadow",
        },
        // 自定义提示内容
        formatter: function (a) {
          var v = a[0];
          return (
            v.name +
            "<br/>" +
            v.marker +
            v.seriesName +
            "：" +
            Math.abs(v.value)
          );
        },
      },
      xAxis: [
        {
          type: "value",
          min: -10,
          max: 0,
          gridIndex: 0,
          axisTick: { show: false, inside: false },
          axisLabel: { show: false },
          axisLine: {
            // Y轴轴线样式
            show: false,
            lineStyle: {
              color: "#000",
            },
          },
          splitLine: {
            show: false,
          },
        },
        {
          type: "value",
          gridIndex: 1,
          min: 0,
          max: 25,
          axisTick: { show: false }, //是否显示刻度
          axisLine: {
            // Y轴轴线样式
            show: false, // 是否显示X轴
            lineStyle: {
              color: "#000",
            },
          },
          axisLabel: {
            show: false, //是否显示X轴内容
          },
          splitLine: {
            show: false,
          },
        },
      ],
      yAxis: [
        {
          type: "category",
          gridIndex: 0,
          inverse: true,
          data: labelData,
          textStyle: {
            color: "#fff",
            fontSize: 14,
          },
          axisTick: { show: false },
          axisLabel: { show: false },
          axisLine: {
            // Y轴轴线样式
            show: false,
            lineStyle: {
              color: "#000",
            },
          },
        },
        {
          type: "category",
          gridIndex: 1,
          inverse: true,
          data: labelData,
          axisTick: { show: false },
          axisLabel: {
            interval: 0,
            textStyle: {
              color: "#ffffff",
            },
          },
          axisLine: {
            show: false, //是否显示轴线
          },
        },
      ],
      grid: [
        {
          top: 30,
          width: "30%",
          left: "5%",
          right: "0%",
          bottom: 5,
          gridIndex: 0,
        },
        {
          top: 30,
          left: "50%",
          bottom: 5,
          gridIndex: 1,
        },
      ],
      color: ["#2FACFA", "#F5A623"],
      series: [
        {
          name: "万列公里/日",
          type: "bar",
          barWidth: "10",
          gridIndex: 0,
          itemStyle: {
            normal: {
              show: true,
              color: "#5de3e1",
              barBorderRadius: 20,
              borderWidth: 0,
              borderColor: "#333",
              label: {
                show: true,
                position: "left",
                formatter: function (v) {
                  return v.value * -1;
                },
              },
            },
          },
          data: womanData,
        },
        {
          name: "万车公里/日",
          type: "bar",
          barWidth: "10",
          xAxisIndex: 1,
          yAxisIndex: 1,
          itemStyle: {
            normal: {
              show: true,
              color: "#8A3EEB",
              barBorderRadius: 20,
              borderWidth: 0,
              borderColor: "#333",
              label: {
                show: true,
                position: "right",
                formatter: function (v) {
                  return v.value;
                },
              },
            },
          },
          data: manData,
        },
      ],
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

//线路车辆数
// lineVehiclesNumChart();
function lineVehiclesNumChart() {
  let lineVehiclesNumC = document.getElementsByClassName(
    "lineVehiclesNum_chart"
  );
  for (var i = 0; i < lineVehiclesNumC.length; i++) {
    let myChart = echarts.init(lineVehiclesNumC[i]);
    var xData = (function () {
      var data = lineVehiclesNumlnNm;
      return data;
    })();

    option = {
      title: {
        x: "4%",
        textStyle: {
          color: "#fff",
          fontSize: "22",
        },
        subtextStyle: {
          color: "#90979c",
          fontSize: "16",
        },
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
          textStyle: {
            color: "#fff",
          },
        },
      },
      grid: {
        borderWidth: 0,
        top: "15%",
        bottom: "15%",
        right: "2%",
        textStyle: {
          color: "#fff",
        },
      },
      legend: {
        x: "center",
        top: "2%",
        textStyle: {
          color: "#fff",
        },
        data: ["上线车辆数", "可用车辆数", "配属车辆数"],
      },
      xAxis: [
        {
          type: "category",
          axisLine: {
            lineStyle: {
              color: "#90979c",
            },
          },
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          splitArea: {
            show: false,
          },
          axisLabel: {
            interval: 0,
            rotate: 45,
            textStyle: {
              color: "#fff",
              fontSize: 10,
            },
          },
          data: xData,
        },
      ],
      yAxis: [
        {
          type: "value",
          splitLine: {
            show: false,
          },
          axisLine: {
            lineStyle: {
              color: "#90979c",
            },
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            interval: 0,
            textStyle: {
              color: "#fff",
            },
          },
          splitArea: {
            show: false,
          },
        },
      ],
      series: [
        {
          name: "上线车辆数",
          type: "bar",
          stack: "总量",
          barMaxWidth: 35,
          barGap: "10%",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,1)",
              label: {
                show: false,
                textStyle: {
                  color: "#fff",
                },
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: lineVehiclesNumlnOnLnVehNr,
        },

        {
          name: "可用车辆数",
          type: "bar",
          stack: "总量",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,.5)",
              barBorderRadius: 0,
              label: {
                show: false,
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: lineVehiclesNumlnAvlVehNr,
        },
        {
          name: "配属车辆数",
          type: "bar",
          stack: "总量",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,.2)",
              barBorderRadius: 0,
              label: {
                show: false,
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: lineVehiclesNumlnAtchVehNr,
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

//加开列次
// additionalTrainsChart();
function additionalTrainsChart() {
  let additionalTrainsC = document.getElementsByClassName(
    "additionalTrains_chart"
  );
  for (var i = 0; i < additionalTrainsC.length; i++) {
    let myChart = echarts.init(additionalTrainsC[i]);
    option = {
      color: ["#1C86F1"],
      tooltip: {},
      grid: {
        left: "10%",
        right: "3%",
        bottom: "12%",
        top: "10%",
        // containLabel: true,
      },
      xAxis: {
        type: "category",
        data: additionalTrainslnNm,
        axisLine: {
          lineStyle: {
            color: "#657CA8",
          },
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#fff",
          rotate: 45,
          interval: 0,
          fontSize: 10,
        },
      },
      yAxis: {
        axisLine: {
          lineStyle: {
            color: "#657CA8",
          },
        },
        axisTick: {
          show: false,
        },
        splitLine: {
          show: false,
        },
        axisLabel: {
          color: "#eee",
        },
      },
      series: [
        {
          type: "bar",
          barWidth: "90%",
          data: additionalTrainslnXtraUntNr,
          label: {
            show: true,
            position: "top",
            textStyle: {
              color: "#ffffff",
            },
          },
          itemStyle: {
            normal: {
              color: function (params) {
                var colorList = [
                  ["#f56868", "transparent"],
                  ["#41ccba", "transparent"],
                  ["#a582ea", "transparent"],
                  ["#f5c379", "transparent"],
                  ["#b4c6cc", "transparent"],
                  ["#74d28c", "transparent"],
                  ["#f4966e", "transparent"],
                  ["#64b2ef", "transparent"],
                ];
                var index = params.dataIndex;
                if (params.dataIndex >= colorList.length) {
                  index = params.dataIndex - colorList.length;
                }
                return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: colorList[index][0] },
                  { offset: 0.5, color: colorList[index][0] },
                  { offset: 1, color: colorList[index][1] },
                ]);
              },
            },
          },
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

//总行驶里程
// totalMileageChart();
function totalMileageChart() {
  // 基于准备好的dom，初始化echarts实例
  let totalMileageC = document.getElementsByClassName("totalMileage_chart");
  for (var i = 0; i < totalMileageC.length; i++) {
    let myChart = echarts.init(totalMileageC[i]);
    var index = 0;
    var colorList = ["#f36c6c", "#e6cf4e", "#20d180", "#0093ff"];
    option = {
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
        },
      },
      legend: {
        show: false,
      },
      grid: {
        left: "28%",
        right: "15%",
        top: "3%",
        bottom: "2%",
      },
      xAxis: {
        type: "value",

        splitLine: {
          show: false,
        },
        axisLabel: {
          show: false,
          interval: 0,
        },
        axisTick: {
          show: false,
        },
        axisLine: {
          show: false,
        },
      },
      yAxis: {
        type: "category",
        inverse: true,
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisPointer: {
          label: {
            show: true,
            margin: 30,
          },
        },
        data: totalMileagelnNm,
        axisLabel: {
          margin: 80,
          align: "left",
          color: "#fff",
          rich: {
            a1: {
              color: "#fff",
              backgroundColor: colorList[0],
              width: 20,
              height: 20,
              align: "center",
              borderRadius: 2,
            },
            a2: {
              color: "#fff",
              backgroundColor: colorList[1],
              width: 20,
              height: 20,
              align: "center",
              borderRadius: 2,
            },
            a3: {
              color: "#fff",
              backgroundColor: colorList[2],
              width: 20,
              height: 20,
              align: "center",
              borderRadius: 2,
            },
            b: {
              color: "#fff",
              backgroundColor: colorList[3],
              width: 20,
              height: 20,
              align: "center",
              borderRadius: 2,
            },
          },
          formatter: function (params) {
            if (index == 10) {
              index = 0;
            }
            index++;
            if (index - 1 < 3) {
              return ["{a" + index + "|" + index + "}" + "  " + params].join(
                "\n"
              );
            } else {
              return ["{b|" + index + "}" + "  " + params].join("\n");
            }
          },
        },
      },
      series: [
        {
          z: 2,
          name: "value",
          type: "bar",
          data: totalMileagelnTotlUntKm.map((item, i) => {
            itemStyle = {
              color: i > 3 ? colorList[3] : colorList[i],
            };
            return {
              value: item,
              itemStyle: itemStyle,
            };
          }),
          label: {
            show: true,
            position: "right",
            color: "#fff",
            fontSize: 14,
            offset: [10, 0],
          },
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}
//开行列次
// trainNumberChart();
function trainNumberChart() {
  let trainNumberC = document.getElementsByClassName("trainNumber_chart");
  for (var i = 0; i < trainNumberC.length; i++) {
    let myChart = echarts.init(trainNumberC[i]);
    option = {
      grid: {
        top: "15%",
        bottom: "15%",
        left: "16%",
        right: "5%",
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
          label: {
            show: true,
          },
        },
      },
      legend: {
        data: ["线路图定开行列次", "线路实际开行列次"],
        top: "2%",
        right: "15",
        textStyle: {
          color: "#fff",
        },
      },
      xAxis: {
        data: trainNumberlnNm,
        axisLine: {
          show: true, //隐藏X轴轴线
          lineStyle: {
            color: "#26D9FF",
            width: 2,
          },
        },
        axisTick: {
          show: true, //隐藏X轴刻度
        },
        axisLabel: {
          show: true,
          interval: 0,
          rotate: 45,
          textStyle: {
            color: "#fff", //X轴文字颜色
            fontSize: 10,
          },
        },
        splitArea: {
          show: true,
          areaStyle: {
            color: ["rgba(250,250,250,0.1)", "rgba(250,250,250,0)"],
          },
        },
      },
      yAxis: [
        {
          type: "value",
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: "#26D9FF",
              width: 2,
            },
          },
          axisLabel: {
            show: true,
            textStyle: {
              color: "#fff",
              fontSize: 12,
            },
          },
        },
        {
          type: "value",
          nameTextStyle: {
            color: "#ebf8ac",
            fontSize: 16,
          },
          position: "right",
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: false,
            textStyle: {
              color: "#fff",
              fontSize: 12,
            },
          },
        },
      ],
      series: [
        {
          name: "线路图定开行列次",
          type: "line",
          yAxisIndex: 1, //使用的 y 轴的 index，在单个图表实例中存在多个 y轴的时候有用
          smooth: true, //平滑曲线显示
          showAllSymbol: true, //显示所有图形。
          symbol: "circle", //标记的图形为实心圆
          symbolSize: 8, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: "#1045A0",
            borderColor: "#3D7EEB",
            width: 2,
            shadowColor: "#3D7EEB",
            shadowBlur: 4,
          },
          lineStyle: {
            color: "#3D7EEB",
            width: 2,
            shadowColor: "#3D7EEB",
            shadowBlur: 4,
          },
          areaStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
              {
                offset: 0,
                color: "rgba(61,126,235, 0.5)",
              },
              {
                offset: 1,
                color: "rgba(61,126,235, 0)",
              },
            ]),
          },
          data: trainNumberlnPlnOpnUntNr,
        },
        {
          name: "线路实际开行列次",
          type: "bar",
          barWidth: 15,
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "rgba(61,126,235, 1)",
                },
                {
                  offset: 1,
                  color: "rgba(61,126,235, 0)",
                },
              ]),
              borderColor: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "rgba(160,196,225, 1)",
                },
                {
                  offset: 1,
                  color: "rgba(61,126,235, 1)",
                },
              ]),
              borderWidth: 2,
            },
          },
          data: trainNumberlnFOpnUntNr,
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}

//线路车辆数
// numLineVehiclesChart();
function numLineVehiclesChart() {
  let numLineVehiclesC = document.getElementsByClassName(
    "numLineVehicles_chart"
  );
  for (var i = 0; i < numLineVehiclesC.length; i++) {
    let myChart = echarts.init(numLineVehiclesC[i]);
    var xData = (function () {
      var data = numLineVehicleslnNm;
      return data;
    })();

    option = {
      title: {
        x: "4%",
        textStyle: {
          color: "#fff",
          fontSize: "22",
        },
        subtextStyle: {
          color: "#90979c",
          fontSize: "16",
        },
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
          textStyle: {
            color: "#fff",
          },
        },
      },
      grid: {
        borderWidth: 0,
        top: "15%",
        bottom: "12%",
        right: "2%",
        textStyle: {
          color: "#fff",
        },
      },
      legend: {
        x: "center",
        top: "2%",
        textStyle: {
          color: "#fff",
        },
        data: ["上线车辆数", "可用车辆数", "配属车辆数"],
      },
      xAxis: [
        {
          type: "category",
          axisLine: {
            lineStyle: {
              color: "#90979c",
            },
          },
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          splitArea: {
            show: false,
          },
          axisLabel: {
            interval: 0,
            rotate: 45,
            textStyle: {
              color: "#fff",
              fontSize: 10,
            },
          },
          data: xData,
        },
      ],
      yAxis: [
        {
          type: "value",
          splitLine: {
            show: false,
          },
          axisLine: {
            lineStyle: {
              color: "#90979c",
            },
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            interval: 0,
            textStyle: {
              color: "#fff",
            },
          },
          splitArea: {
            show: false,
          },
        },
      ],
      series: [
        {
          name: "上线车辆数",
          type: "bar",
          stack: "总量",
          barMaxWidth: 35,
          barGap: "10%",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,1)",
              label: {
                show: false,
                textStyle: {
                  color: "#fff",
                },
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: numLineVehicleslnOnLnVehNr,
        },

        {
          name: "可用车辆数",
          type: "bar",
          stack: "总量",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,.5)",
              barBorderRadius: 0,
              label: {
                show: false,
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: numLineVehicleslnAvlVehNr,
        },
        {
          name: "配属车辆数",
          type: "bar",
          stack: "总量",
          itemStyle: {
            normal: {
              color: "rgba(93,227,225,.2)",
              barBorderRadius: 0,
              label: {
                show: false,
                position: "inside",
                formatter: function (p) {
                  return p.value > 0 ? p.value : "";
                },
              },
            },
          },
          data: numLineVehicleslnAtchVehNr,
        },
      ],
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}
//准点列车次数
// onTimeTrainChart();
function onTimeTrainChart() {
  let onTimeTrainC = document.getElementsByClassName("onTimeTrain_chart");
  for (var i = 0; i < onTimeTrainC.length; i++) {
    let myChart = echarts.init(onTimeTrainC[i]);
    option = {
      grid: {
        top: "6%",
        right: "5%",
        left: "18%",
        bottom: "12%",
      },
      xAxis: [
        {
          type: "category",
          data: onTimeTrainlnNm,
          axisLine: {
            lineStyle: {
              color: "rgba(255,255,255,0.12)",
            },
          },
          axisLabel: {
            // margin: 10,
            interval: 0,
            rotate: 45,
            color: "#fff",
            textStyle: {
              fontSize: 10,
            },
          },
        },
      ],
      yAxis: [
        {
          //name: '单位：万元',
          axisLabel: {
            formatter: "{value}",
            color: "#e2e9ff",
          },
          axisLine: {
            show: false,
            lineStyle: {
              color: "rgba(255,255,255,1)",
            },
          },
          splitLine: {
            lineStyle: {
              color: "rgba(255,255,255,0.12)",
            },
          },
        },
      ],
      series: [
        {
          type: "bar",
          data: onTimeTrainlnOnSchdlUntNr,
          barWidth: "10px",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: "rgba(0,244,255,1)", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(0,77,167,1)", // 100% 处的颜色
                  },
                ],
                false
              ),
              barBorderRadius: [30, 30, 30, 30],
              shadowColor: "rgba(0,160,221,1)",
              shadowBlur: 4,
            },
          },
          // label: {
          //   normal: {
          //     show: true,
          //     lineHeight: 30,
          //     width: 70,
          //     height: 30,
          //     backgroundColor: "rgba(0,160,221,0.1)",
          //     borderRadius: 200,
          //     position: ["-12", "-60"],
          //     distance: 1,
          //     formatter: ["    {d|●}", " {a|{c}}     \n", "    {b|}"].join(","),
          //     rich: {
          //       d: {
          //         color: "#3CDDCF",
          //       },
          //       a: {
          //         color: "#fff",
          //         align: "center",
          //       },
          //       b: {
          //         width: 1,
          //         height: 30,
          //         borderWidth: 1,
          //         borderColor: "#234e6c",
          //         align: "left",
          //       },
          //     },
          //   },
          // },
        },
      ],
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}
